package TouristManagement;

/**
 * Interface definition : TouristOffice
 * 
 * @author OpenORB Compiler
 */
public abstract class TouristOfficePOA extends org.omg.PortableServer.Servant
        implements TouristOfficeOperations, org.omg.CORBA.portable.InvokeHandler
{
    public TouristOffice _this()
    {
        return TouristOfficeHelper.narrow(_this_object());
    }

    public TouristOffice _this(org.omg.CORBA.ORB orb)
    {
        return TouristOfficeHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:TouristManagement/TouristOffice:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("consultGlobalStat")) {
                return _invoke_consultGlobalStat(_is, handler);
        } else if (opName.equals("consultListeSites")) {
                return _invoke_consultListeSites(_is, handler);
        } else if (opName.equals("consultLocalStat")) {
                return _invoke_consultLocalStat(_is, handler);
        } else if (opName.equals("existTourist")) {
                return _invoke_existTourist(_is, handler);
        } else if (opName.equals("getIdSite")) {
                return _invoke_getIdSite(_is, handler);
        } else if (opName.equals("isVisitingSite")) {
                return _invoke_isVisitingSite(_is, handler);
        } else if (opName.equals("purchaseCard")) {
                return _invoke_purchaseCard(_is, handler);
        } else if (opName.equals("siteVisiting")) {
                return _invoke_siteVisiting(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_purchaseCard(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        TouristManagement.DateV arg1_in = TouristManagement.DateVHelper.read(_is);
        TouristManagement.DateV arg2_in = TouristManagement.DateVHelper.read(_is);

        short _arg_result = purchaseCard(arg0_in, arg1_in, arg2_in);

        _output = handler.createReply();
        _output.write_short(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_consultListeSites(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();
        TouristManagement.CoordsGPS arg1_in = TouristManagement.CoordsGPSHelper.read(_is);

        TouristManagement.InfoSite[] _arg_result = consultListeSites(arg0_in, arg1_in);

        _output = handler.createReply();
        TouristManagement.listInfoSitesHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_consultGlobalStat(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        TouristManagement.GlobalStat _arg_result = consultGlobalStat();

        _output = handler.createReply();
        TouristManagement.GlobalStatHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_consultLocalStat(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        TouristManagement.LocalStat _arg_result = consultLocalStat(arg0_in);

        _output = handler.createReply();
        TouristManagement.LocalStatHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_getIdSite(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        short[] _arg_result = getIdSite();

        _output = handler.createReply();
        TouristManagement.ListShortHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_siteVisiting(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        TouristManagement.Site _arg_result = siteVisiting(arg0_in);

        _output = handler.createReply();
        TouristManagement.SiteHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_existTourist(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        boolean _arg_result = existTourist(arg0_in);

        _output = handler.createReply();
        _output.write_boolean(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_isVisitingSite(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        short arg0_in = _is.read_short();

        boolean _arg_result = isVisitingSite(arg0_in);

        _output = handler.createReply();
        _output.write_boolean(_arg_result);

        return _output;
    }

}
